package com.transaction.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.transaction.config.R;
import com.transaction.domain.SysDictData;
import com.transaction.service.SysDictDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("dictData")
public class DictDataController {

    @Autowired
    SysDictDataService sysDictDataService;

    @GetMapping("getlist")
    public R getDictByType(String type){
        QueryWrapper<SysDictData> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("dict_type",type);
        List<SysDictData> list = sysDictDataService.list(queryWrapper);
        return R.successed(list);
    }
}
